home *** CD-ROM | disk | FTP | other *** search
/ GRAVIS Top 100 #5 / GRAVIS CD No5_Herbst_95.cdr / GRAVIS / Updates / Debabelizer 1.6.5 Update / Copy Contents to Custom Code ƒ / CODE misc swap CRLF / CODE misc swap CRLF.rsrc / TEXT_1000_Swap CRs and LFs in File.txt < prev    next >
Text File  |  1995-04-04  |  1KB  |  3 lines

  1. Swap CRs and LFs in File
  2. This function will go through a file one character (byte) at a time and swap Carriage Return characters (decimal value 13) and Line Feed characters (decimal value 10).
  3. When files are transmitted over a network from a Unix machine to a Mac they are sometimes sent incorrectly by the network software.  There are two basic modes for transmitting files: "Binary" and "Text". When sent in binary mode, every byte in the file is sent without alteration; this is the desired mode for transmitting image files. When sent in text mode, the network software alters the bytes it sends over in order to correct for the different way the computers handle text; this is definitely the wrong way to send image files. Very often this text transfer mode involves swapping Carriage Returns and Line Feeds. Other possibilities include deleting CRs, deleting LFs, inserting CRs, inserting LFs. This "Swap CRs and LFs" function will only correct problems created by network software that swaps CRs and LFs. The ideal solution of course is to change the network software transfer mode to Binary for the transfer and retransfer the files.